package ginRoute

import (
	"github.com/gin-gonic/gin"
	"github.com/gookit/color"
	"net/http"
)

func BodyJsonWithErr[T any](ctx *gin.Context, v *T) bool {
	err := ctx.ShouldBindJSON(v)
	if err != nil {
		ErrorWithDetail(ctx, http.StatusBadRequest, "Params", err)
		return true
	}
	color.Greenln(":", v)
	return false
}
